import { Card, Input } from "antd";
import {setGlobalText} from "../../redux/productSlice"
import { useDispatch, useSelector } from "react-redux";
export default function Setting(){
    const dispatch = useDispatch()
    const text = useSelector((state: unknown) => (state as { product: { globalText: string } }).product.globalText)
    const handlChangeText = (e: React.ChangeEvent<HTMLInputElement>)=>{
        console.log(e.target.value)
        dispatch(setGlobalText(e.target.value))
    }
    return(
        <>
          <Card>
            <Input placeholder="请告诉全世界" value={text} allowClear onChange={handlChangeText}/>
          </Card>
        </>
    )
}